void roundRect(float x1, float y1, float x2, float y2 )
{ 
  if( x1 > x2 )
  {
    float temp = x1;
    x1 = x2;
    x2 = temp;
  }
  if( y1 > y2 )
  {
    float temp = y1;
    y1 = y2;
    y2 = temp;
  }
  smooth();
  float perc = .3;
  float rad = abs( perc*(x2-x1) );
  if( (y2-y1) < (x2-x1) )
  {
    rad = abs( perc*(y2-y1) );
  }  
  
  rectMode( CORNERS );
  rect( x1+rad, y1, x2-rad, y2 );
  rect( x1, y1+rad, x2, y2-rad );
  
  //ellipse( x1+dispFromX, y1+dispFromY, 2*dispFromX, 2*dispFromY );
  ellipseMode( CORNERS );
  ellipse( x1, y1, x1+2*rad, y1+2*rad );
  ellipse( x1, y2, x1+2*rad, y2-2*rad );
  ellipse( x2, y2, x2-2*rad, y2-2*rad );
  ellipse( x2, y1, x2-2*rad, y1+2*rad );
}

void drawArrow( float x1, float y1, float x2, float y2)
{
  strokeWeight( (int) abs(y2-y1) );
  line(x1, y1, x2, y2);
  pushMatrix();
  translate(x2, y2);
  float a = atan2(x1-x2, y2-y1);
  rotate(a);
  //line(0, 0, -10, -10);
  //line(0, 0, 10, -10);
  float h = abs(y2-y1)*.3;
  triangle( 1, 1, -1*h, -1*h, h, -1*h );
  popMatrix();
}
